import { ORDER_TOKEN } from '@/apis'
import { Navigate } from 'react-router-dom'

export const Auth = ({ children }: { children: React.ReactNode }) => {
  const token = localStorage.getItem(ORDER_TOKEN)
  if (token) {
    return <>{children}</>
  } else {
    return <Navigate to="/login" replace />
  }
}
